Package-level declarations

Types

Link copied to clipboard
@Stable
interface ApplicationScope

Scope used by glfwApplication.

Link copied to clipboard
data class Direct3DRenderContext(val directContext: DirectContext, val hwnd: Long, val adapter: Long, val device: Long, val commandQueue: Long, val swapChain: Long, val compositionDevice: Long, val compositionTarget: Long, val compositionVisual: Long) : RenderContext

Direct3D render context for a Compose GLFW window.

Link copied to clipboard

Display server used by GLFW for a window.

Link copied to clipboard
data class DroppedFiles(val paths: List<Path>)

Files dropped onto a Compose GLFW window.

Link copied to clipboard
data class FileDialogFilter(val name: String, val extensions: List<String>)

File type filter shown by native file pickers.

Link copied to clipboard
interface FilePicker

Native file and folder picker for a Compose GLFW window.

Link copied to clipboard
interface HostWindow

Current host window.

Link copied to clipboard
data class HostWindowInfo(val displayServer: DisplayServer, val displayName: String?, val renderBackend: RenderBackend, val framebufferWidth: Int, val framebufferHeight: Int, val windowWidth: Int, val windowHeight: Int, val contentScale: Float)

Current host window, display, and renderer information.

Link copied to clipboard
interface HostWindowScope

Values available to content hosted in a GLFW window.

Link copied to clipboard
data class MetalRenderContext(val directContext: DirectContext, val view: Long, val layer: Long, val device: Long, val queue: Long) : RenderContext

Metal render context for a Compose GLFW window.

Link copied to clipboard
data class OpenGlRenderContext(val directContext: DirectContext, val eglDisplay: Long, val eglConfig: Long, val eglContext: Long, val getProcAddress: Long, val resolveProcAddress: (String) -> Long, val makeCurrent: () -> Unit) : RenderContext

OpenGL render context for a Compose GLFW window.

Link copied to clipboard

Renderer used to draw Compose content.

Link copied to clipboard
sealed interface RenderContext

Backend-specific render context for a hosted Compose window.

Link copied to clipboard

Actions that custom text toolbar content can perform.

Link copied to clipboard
typealias TextToolbarContent = @Composable (state: TextToolbarState, actions: TextToolbarActions) -> Unit

Composable content used to show text editing actions.

Link copied to clipboard
data class TextToolbarState(val rect: Rect, val canCopy: Boolean, val canPaste: Boolean, val canCut: Boolean, val canSelectAll: Boolean, val canAutofill: Boolean)

State passed to custom text toolbar content.

Link copied to clipboard

Host-specific options used when creating a GLFW window.

Link copied to clipboard

Describes how a window is placed on the screen.

Link copied to clipboard
@Immutable
sealed class WindowPosition

Position of a window on screen in Dp.

Link copied to clipboard
@Stable
interface WindowState

Runtime state for a GLFW window.

Properties

Link copied to clipboard
val LocalWindow: ProvidableCompositionLocal<HostWindow>

Current Compose GLFW window.

Functions

Link copied to clipboard
fun cursorImagePointerIcon(image: ImageBitmap, imageScale: Float, hotSpot: IntOffset = IntOffset.Zero): PointerIcon

Creates a pointer icon from an image.

Link copied to clipboard
fun DragAndDropEvent.droppedFilesOrNull(): DroppedFiles?

Returns the dropped files carried by this event, or null if it is not a file drop event.

Link copied to clipboard
fun Modifier.fileDropTarget(accept: (DroppedFiles) -> Boolean = { true }, onStarted: (DroppedFiles) -> Unit = {}, onEntered: (DroppedFiles) -> Unit = {}, onMoved: (DroppedFiles) -> Unit = {}, onExited: (DroppedFiles) -> Unit = {}, onChanged: (DroppedFiles) -> Unit = {}, onEnded: (DroppedFiles) -> Unit = {}, onDrop: (DroppedFiles) -> Unit): Modifier

Adds a file drop target to this modifier chain.

Link copied to clipboard
fun glfwApplication(content: @Composable ApplicationScope.() -> Unit)

Starts a Compose GLFW application and runs until the application exits.

Link copied to clipboard
@Composable
fun rememberWindowState(placement: WindowPlacement = WindowPlacement.Floating, isMinimized: Boolean = false, position: WindowPosition = WindowPosition.PlatformDefault, size: DpSize = DpSize(800.dp, 600.dp)): WindowState

Creates a WindowState that is remembered across compositions.

Link copied to clipboard
@Composable
fun ApplicationScope.Window(onCloseRequest: () -> Unit, state: WindowState = rememberWindowState(), visible: Boolean = true, title: String = "Untitled", undecorated: Boolean = false, transparent: Boolean = false, resizable: Boolean = true, enabled: Boolean = true, focusOnShow: Boolean = true, alwaysOnTop: Boolean = false, onPreviewKeyEvent: (KeyEvent) -> Boolean = { false }, onKeyEvent: (KeyEvent) -> Boolean = { false }, options: WindowOptions = WindowOptions(), content: @Composable HostWindowScope.() -> Unit)

Composes a GLFW window in the current application composition.

Link copied to clipboard
fun WindowPosition(alignment: Alignment): WindowPosition

Constructs an aligned WindowPosition.

fun WindowPosition(x: Dp, y: Dp): WindowPosition

Constructs an absolute WindowPosition from x and y.

Link copied to clipboard
fun WindowState(placement: WindowPlacement = WindowPlacement.Floating, isMinimized: Boolean = false, position: WindowPosition = WindowPosition.PlatformDefault, size: DpSize = DpSize(800.dp, 600.dp)): WindowState

Creates a state object that can be hoisted to control and observe window attributes.